<?php 
//load in the categories
$nc = new News_category;

$cat_array = $nc->List_frontend_categories(0);
$cat_array_count = count($cat_array);
?>
<div class="sub-nav">
	<ul>
		<li class="first">Show</li>
		<li class="all<?php echo (is_null($category_slug)) ? ' on' : null; ?>"><a href="/news">All</a></li>
		<?php 
		if($cat_array_count > 0)
		{
			foreach($cat_array as $cat)
			{
			?>
			<li class="<?php echo $cat['url_slug']?><?php echo ($category_slug == $cat['url_slug'])?' on' : null; ?>"><a href="/news/<?php echo $cat['url_slug']?>"><?php echo $cat['title']?></a></li>
			<?php			
			}
		}
		?>
	</ul>
</div>